There’s lot going on here. Pretty much it is the two ends actually talking to each other: the playlist/track library import + the sound source.
I am encoding the track URI as base64+url. Originally I was going to do base32, but I was able to use QT’s library for the former whereas I’d have to do something else for the latter, so I rolled with it. It should be assumed to be opaque in the future though, this is just a hack that works.
The filename encoder is setup to use the URL-safe version of base64 encoding—/tmp/{base64(spotify_link(track))}.spotify, when the import happens. When load happens, we do the inverse operation to get the track from the .spotify filename.
So what is happening in the black console, is I am trying to load the track /tmp/c38…spotify and it doesn’t exist. So I go to the white console and copy the hand-made .wav file to the expected .spotify file location and try again; presto!
Next, I will write the .spotify (.wav) file header upon import with 0 length, and then upon creation of the SoundSourceSpotify I will queue a worker and block until it finishes; the worker would sp_session_player_play(track,1) and append the file, updating the headers when done. I know, blocking, HORRIFUCKIBLE, but this is the first iteration, bitch. I have some ideas to make this usable, maybe in time for hackerfair! but I need to think about presentation, too.